%{
#include<stdio.h>
int num_section = 0;
int num_subsection = 0;
%}

%%
\\section\{([^}])*     {num_section++; num_subsection = 0; printf("La section numero %d : %s\n",num_section, yytext+9);}
\\subsection\{([^}])*  {num_subsection++; printf("la sous-section numero %d de la section numero %d est : %s\n",num_subsection, num_section, yytext+12);}
.  {;}
\n {;}
%%
int main () {
yylex ();
}